1. Field of the Invention
The present invention relates to the field of computers. More particularly, the present invention relates to memory overload protection in the technology of heap management of an application server.
2. Description of the Related Art
Memory overload is one of the key challenges in managing enterprise application server performance such as in J2EE application server environment. Generally, such an application server is mainly implemented by Java virtual machine, which has limited memory capacity. The memory of the application server is continually used by various applications, and garbage collection (GC) is automatically applied to reclaim the unused space from the memory heap. If the actual heap utilization of the application server reaches the maximum available heap size, the application server will be out of memory, which results in the crash of the application server. In addition, when the actual heap utilization is high, the performance of the application tends to degrade dramatically, which is crucial for real-time applications, such as Session Initiation Protocol (SIP) applications.
In the SIP applications such as Voice over IP (VoIP) applications, SIP was adopted as the signaling protocol for establishing SIP sessions between SIP clients in an IP network. FIG. 1 illustrates a message flow of a SIP session. As shown in FIG. 1, a SIP server provides a SIP session application to a SIP client. A calling SIP client initiates a call by an INVITE message, and establishes a SIP session with a called SIP client through the SIP server. During the session, the SIP server records the relevant information of the SIP session, which is typically tens to hundreds of K bytes. Then, either of the SIP clients can terminate the session by a BYE message. A typical call duration distribution is lognormal with an average between 60 and 300 seconds. However, sometimes the SIP session would hold the memory of the SIP server for a long time, for example, 400 seconds or more. Therefore, if there is a plurality of such SIP sessions, the SIP server's available memory would be readily exhausted, thus increasing SIP server's risk of crashing.
In addition, the actual heap utilization of the application server is also directly impacted by multiple factors such as call arrival rate, call hold time, and memory being held during a call. Furthermore, in an enterprise environment, all of these factors are highly variable and some of them are even difficult to be captured at runtime. For example, the range of the call hold time can vary from several seconds to hundreds of minutes.
To prevent memory overload, currently some memory overload protection schemes for the application server have been proposed. For example, the memory overload protection scheme provided by BEA Inc. requires explicit configuration of parameters such as thread pool size, queue length limit and maximum number of HTTP sessions. However, these parameters do not directly reflect the application server's actual heap utilization and generally are set based on the system administrator's experience. As the characteristics of each application often vary over time, it is hard to set the optimal values for the above parameters, which may result in that the memory overload protection cannot be performed effectively. Details on such memory overload protection scheme can be found in Configuring WebLogic Server to Avoid Overload Conditions, Oracle, which is available at http://edocs.bea.com/wls/docs103/config_wls/overload.html.
Recently, it is also proposed to apply control theory based analytical methods to performance and memory management of the application server. For example, a scheme for managing CPU and heap utilization by a multiple-input multiple-output controller is proposed in “Using MIMO feedback control to enforce policies for interrelated metrics with application to the Apache web server” written by Y. Diao, N. Gandhi, J. L. Hellerstein, S. Parekh, and D. M. Tilbury, in which the MIMO controller manipulates the related tuning parameters such as the maximum number of clients. However, in this scheme, because the controller's control gain is a fixed value, the changes in the application characteristic cannot be tracked very well.